<?php

namespace app\common\validate\ads;

use app\common\validate\BaseValidate;


class Ad extends BaseValidate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'title' => 'require|length:1, 100',
        'money_amount' => 'number|egt:1',
        'money_count'   => 'number|egt:100',
        'content' => 'require',
        'linkname'  => 'require',
        'telephone' =>  'require|isMobile',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'title.require' => '请填写标题',
        'title.max' => '标题30字以内',
        'money_amount.number'  => '赏金总额必须是数字',
        'money_amount.egt'  => '赏金总额请填写1以上任何数字',
        'money_count.number'    => '赏金份数必须是数字',
        'money_count.egt'   => '赏金份数请填写100以上任何数字',
        'content'   => '请填写内容',
        'linkname'  => '请填写联系人',
        'telephone.require' =>  '请填写联系人电话',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => [],
        'edit' => [],
        'add_money' =>['title', 'money_amount', 'money_count', 'linkname', 'telephone'],
        'add_free' =>['title', 'content', 'linkname', 'telephone'],
    ];
    
}
